(:
  A procedure to select the contents of the "chat" interventions
:)
declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ; 


<display>{

let $startdate := if ($arguments[2]) then xs:dateTime($arguments[2]) else xs:dateTime("1900-01-01T01:00:00")
let $enddate := if ($arguments[3]) then xs:dateTime($arguments[3]) else xs:dateTime("2100-01-01T01:00:00")
let $t := $arguments[1]

for $item in doc($t)/display/item 
	let $time := xs:integer($item/info[@name="time"]/time/date)
	let $datetime := jj:unix-to-dateTime($time)
	where $datetime <= $enddate and $datetime >= $startdate 
	return $item


}</display>
